package co.yixiang.yshop.module.product.controller.admin.storeproductstocklog;

import co.yixiang.yshop.framework.common.pojo.CommonResult;
import co.yixiang.yshop.framework.common.pojo.PageResult;
import co.yixiang.yshop.module.product.controller.admin.storeproductstocklog.vo.StoreProductStockLogPageReqVO;
import co.yixiang.yshop.module.product.controller.admin.storeproductstocklog.vo.StoreProductStockLogRespVO;
import co.yixiang.yshop.module.product.service.storeproductstocklog.StoreProductStockLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 商品库存记录")
@RestController
@RequestMapping("/product/store-product-stock-log")
@Validated
public class StoreProductStockLogController {

    @Resource
    private StoreProductStockLogService storeProductStockLogService;




    @GetMapping("/page")
    @Operation(summary = "获得商品库存记录分页")
    @PreAuthorize("@ss.hasPermission('product:store-product-stock-log:query')")
    public CommonResult<PageResult<StoreProductStockLogRespVO>> getStoreProductStockLogPage(@Valid StoreProductStockLogPageReqVO pageVO) {
        return success(storeProductStockLogService.getStoreProductStockLogPage(pageVO));
    }



}
